﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true"
    CodeBehind="AOrganisationList.aspx.cs" Inherits="AB.ServiceDirectory.Design.Org.AOrganisationList"
    EnableEventValidation="false" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <script type="text/javascript" language="Javascript">
        function Confirm_Edit() {

            if (confirm("Do you want to make this Organization active?") == true)
                return true;
            else
                return false;
        }
    </script>
</asp:Content>
<asp:Content ID="ContentTitle" ContentPlaceHolderID="ContentTitle" runat="server">
    <h2>
        Organisation List</h2>
</asp:Content>
<asp:Content ID="Content" ContentPlaceHolderID="Content" runat="server">
    <div class="grid740 simplebox">
        <div class="titleh">
            <h3 class="sorting_range">
                <asp:LinkButton ID="LinkButtonAll" runat="server" CssClass="hg-blue" CommandName="all"
                    OnCommand="FilterByLetters_Command">All</asp:LinkButton>
                <asp:LinkButton ID="LinkButton09" runat="server" CommandName="09" OnCommand="FilterByLetters_Command">0-9</asp:LinkButton>
                <asp:LinkButton ID="LinkButtonAE" runat="server" CommandName="ae" OnCommand="FilterByLetters_Command">A B C D E</asp:LinkButton>
                <asp:LinkButton ID="LinkButtonFJ" runat="server" CommandName="fj" OnCommand="FilterByLetters_Command">F G H I J</asp:LinkButton>
                <asp:LinkButton ID="LinkButtonKN" runat="server" CommandName="kn" OnCommand="FilterByLetters_Command">K L M N </asp:LinkButton>
                <asp:LinkButton ID="LinkButtonOR" runat="server" CommandName="or" OnCommand="FilterByLetters_Command">O P Q R</asp:LinkButton>
                <asp:LinkButton ID="LinkButtonSV" runat="server" CommandName="sv" OnCommand="FilterByLetters_Command">S T U V</asp:LinkButton>
                <asp:LinkButton ID="LinkButtonWZ" CssClass="last" runat="server" CommandName="wz"
                    OnCommand="FilterByLetters_Command">W X Y Z</asp:LinkButton>
                <span class="right">
                    <asp:HyperLink ID="HyperLinkCreate" runat="server" CssClass="hg-blue">Create</asp:HyperLink>
                    <asp:CheckBox ID="CheckBoxInactive" runat="server" Text="Include In-active" AutoPostBack="True"
                        OnCheckedChanged="CheckBoxInactive_CheckedChanged" />
                </span>
            </h3>
        </div>
        <asp:ObjectDataSource ID="OrganizationObjectDataSource" runat="server" EnablePaging="True"
            MaximumRowsParameterName="maxRows" SelectCountMethod="GetListOrganisationCount"
            SelectMethod="GetListOrganisation" SortParameterName="sortType" TypeName="AB.ServiceDirectory.BO.AOrganisationBo"
            OnSelecting="OrganizationObjectDataSource_Selecting">
            <SelectParameters>
                <asp:Parameter Name="filter" Type="Object" />
            </SelectParameters>
        </asp:ObjectDataSource>
        <asp:GridView ID="GridViewOrg" CssClass="tablesorter" runat="server" AutoGenerateColumns="False"
            AllowPaging="True" PageSize="15" AllowSorting="True" DataSourceID="OrganizationObjectDataSource"
            OnRowDataBound="GridViewOrg_RowDataBound" OnSelectedIndexChanged="GridViewOrg_SelectedIndexChanged"
            DataKeyNames="OrganisationId">
            <Columns>
                <asp:TemplateField HeaderText="Organisation Name" SortExpression="OrganizationName">
                    <ItemTemplate>
                        <asp:LinkButton ID="LinkButtonOrganisationName" runat="server" CommandArgument='<%# Eval("OrganisationId") %>'
                            OnCommand="LinkButtonOrganisationName_Command" Text='<%# Eval("OrganisationName") %>'></asp:LinkButton>
                    </ItemTemplate>
                    <HeaderStyle CssClass="header" />
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Head Office Address Line 1" SortExpression="AddressLine">
                    <ItemTemplate>
                        <asp:Label ID="LabelHeadOffice" runat="server" Text='<%# Eval("Address.AddressLine") %>'></asp:Label>
                    </ItemTemplate>
                    <HeaderStyle CssClass="header" />
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Postcode" SortExpression="PostCode">
                    <ItemTemplate>
                        <asp:Label ID="LabelPostCode" runat="server" Text='<%# Eval("Address.PostCode") %>'></asp:Label>
                    </ItemTemplate>
                    <HeaderStyle CssClass="header" />
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Contact" SortExpression="Contact">
                    <ItemTemplate>
                        <%# String.Format("{0} {1}",Eval("Contact.FirstName"),Eval("Contact.SurName")) %>
                    </ItemTemplate>
                    <HeaderStyle CssClass="header" />
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Is Active ?" SortExpression="IsActive">
                    <ItemTemplate>
                        <asp:Label ID="Label1" runat="server" Text='<%#(bool)Eval("IsActive")?"Yes":"No"%>'></asp:Label>
                    </ItemTemplate>
                    <HeaderStyle CssClass="header" />
                </asp:TemplateField>
            </Columns>
            <PagerStyle CssClass="pagination_table"></PagerStyle>
        </asp:GridView>
    </div>
</asp:Content>
